package com.ruoyi.inventory.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.inventory.mapper.BizStockFlowMapper;
import com.ruoyi.inventory.domain.BizStockFlow;
import com.ruoyi.inventory.service.IBizStockFlowService;
import com.ruoyi.common.core.text.Convert;

/**
 * 库存流水Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-16
 */
@Service
public class BizStockFlowServiceImpl implements IBizStockFlowService 
{
    @Autowired
    private BizStockFlowMapper bizStockFlowMapper;

    /**
     * 查询库存流水
     * 
     * @param flowId 库存流水主键
     * @return 库存流水
     */
    @Override
    public BizStockFlow selectBizStockFlowByFlowId(Long flowId)
    {
        return bizStockFlowMapper.selectBizStockFlowByFlowId(flowId);
    }

    /**
     * 查询库存流水列表
     * 
     * @param bizStockFlow 库存流水
     * @return 库存流水
     */
    @Override
    public List<BizStockFlow> selectBizStockFlowList(BizStockFlow bizStockFlow)
    {
        return bizStockFlowMapper.selectBizStockFlowList(bizStockFlow);
    }

    /**
     * 新增库存流水
     * 
     * @param bizStockFlow 库存流水
     * @return 结果
     */
    @Override
    public int insertBizStockFlow(BizStockFlow bizStockFlow)
    {
        bizStockFlow.setCreateTime(DateUtils.getNowDate());
        return bizStockFlowMapper.insertBizStockFlow(bizStockFlow);
    }

    /**
     * 修改库存流水
     * 
     * @param bizStockFlow 库存流水
     * @return 结果
     */
    @Override
    public int updateBizStockFlow(BizStockFlow bizStockFlow)
    {
        return bizStockFlowMapper.updateBizStockFlow(bizStockFlow);
    }

    /**
     * 批量删除库存流水
     * 
     * @param flowIds 需要删除的库存流水主键
     * @return 结果
     */
    @Override
    public int deleteBizStockFlowByFlowIds(String flowIds)
    {
        return bizStockFlowMapper.deleteBizStockFlowByFlowIds(Convert.toStrArray(flowIds));
    }

    /**
     * 删除库存流水信息
     * 
     * @param flowId 库存流水主键
     * @return 结果
     */
    @Override
    public int deleteBizStockFlowByFlowId(Long flowId)
    {
        return bizStockFlowMapper.deleteBizStockFlowByFlowId(flowId);
    }
}
